package noobteam.deartrainer.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @Author 赵崇轩
 * @Date 2021/6/25 16:15
 * @Version 1.0
 */
@Mapper
public interface AdministratorInfoMapper {
    /**
     * 注册时查询管理员name
     */
    @Select("SELECT administratorName FROM administratorinfo")
    public List<Map<String,Object>> selectName();

    /**
     * 查询已有密码
     * 传入此管理员的name
     * 返回List为现在的密码
     */
    @Select("SELECT administratorPassword FROM administratorinfo WHERE administratorName = #{administratorName}")
    public Map<String,Object> selectPasswordByName(String administratorName);

    @Select("SELECT a.administratorId, a.administratorImage, a.administratorPhone \n" +
            "FROM deartrainer.administratorinfo a \n" +
            "WHERE a.administratorName = #{adminName};")
    public Map<String,Object> findAdminByName(String adminName);

}
